from flask_restful import Resource, marshal_with
from App.model import *
from App.util.response import ResponseUtils
from flask import request


class HelloResource(Resource):
    @marshal_with(build_response_type(user_vo))
    def get(self):
        first = User.query.first()
        print('hello first')
        print(first.username)
        return ResponseUtils.success(first)

    @marshal_with(build_response_type())
    def post(self):
        j = request.get_json()
        print('hello json')
        print(j)
        return ResponseUtils.success()
